package com.data.hijack.http;

import java.util.regex.Pattern;

/**
 * @auther husq
 */
public interface HttpConstants {
    String CONTENT_DISPOSITION_REGEX = "([ |\t]*Content-Disposition[ |\t]*:)(.*)";
    public static final String CONTENT_DISPOSITION_ATTRIBUTE_REGEX =
        "[ |\t]*([a-zA-Z]*)[ |\t]*=[ |\t]*['|\"]([^\"^']*)['|\"]";
    String CONTENT_TYPE_REGEX = "([ |\t]*content-type[ |\t]*:)(.*)";

    Pattern CONTENT_DISPOSITION_ATTRIBUTE_PATTERN = Pattern.compile(CONTENT_DISPOSITION_ATTRIBUTE_REGEX);

    Pattern CONTENT_DISPOSITION_PATTERN = Pattern.compile(CONTENT_DISPOSITION_REGEX, Pattern.CASE_INSENSITIVE);
    Pattern CONTENT_TYPE_PATTERN = Pattern.compile(CONTENT_TYPE_REGEX, Pattern.CASE_INSENSITIVE);
    public static final int SOCKET_READ_TIMEOUT = 5000;

    public static final String MIME_PLAINTEXT = "text/plain";

    public static final String MIME_HTML = "text/html";

    public static final String QUERY_STRING_PARAMETER = "NanoHttpd.QUERY_STRING";

    String STREAM_SHUTDOWN = "Stream Shutdown";

    String HTTP_POST_DATA_KEY = "postData";
    String POST_FORM_FORMAT = "application/x-www-form-urlencoded";
    String POST_BOUNDARY_FORMAT = "multipart/form-data";

}
